Ext.define('Admin.common.panel.AgsMap', {
    extend: 'Ext.Component',
    xtype: 'agsMap',
    layout: 'fit',
    config: {
        map: null
    },
    initComponent: function() {
        this.callParent();
    },
    onBoxReady: function() {
        console.log("<<<<<<<<<<<", arguments);
        Ext.Component.prototype.onBoxReady.apply(this, arguments);
        if (window.require == null) {
            this.update("ArcGIS Javascript API not load。");
        } else {
            this.createMap();
        }
    },
    createMap: function() {
        var b = this;
        require(["esri/map", "dojo/domReady!"],
            function(a) {
                var d = new a(b.getId(), {
                    center: [111, 28.5],
                    zoom: 7,
                    showLabels: true
                });
                b.setMap(d);
                b.fireEvent("mapInit", d);
            }
        );
    },
    redraw: function() {
        var b = this.getMap();
        if (b) {
            b.resize();
            b.reposition();
        }
    }
});